﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data.Linq.Mapping;
using System.ComponentModel.DataAnnotations;
using System.Data.Linq;
using System.ComponentModel;
using System.Reflection;
using NDepot.Models.UI;
using NDepot.Models.Base;

namespace NDepot.Models
{
    [Table]
    public class Order : PersistentObject
    {
        [Column(IsPrimaryKey = true)]
        public Guid Id { get; set; }

        [Column]
        public string Name { get; set; }

        [Column]
        public string Address { get; set; }

        [Column]
        public string EMail { get; set; }

        [Column]
        public string PayType { get; set; }

        private EntitySet<LineItem> _LineItems = new EntitySet<LineItem>();
        [System.Data.Linq.Mapping.Association(Storage = "_LineItems", OtherKey = "OrderId")]
        public EntitySet<LineItem> LineItems
        {
            get { return this._LineItems; }
            set { this._LineItems.Assign(value); }
        }

        public Order()
        {
            Id = Guid.NewGuid();
        }
    }
}